(function run(tests) {
	var i;
	for (i = 0; i < tests.length; i++) {
		tests[i]();
		klib.log('***********************************************************');
	}
})([
    function() {
    	var fibonacci = function(n) {
    		return n == 0 || n == 1 ? 1 : fibonacci(n - 2) + fibonacci(n - 1);
    	};
    	klib.logged(klib.timed(fibonacci))(25);
    },
    function() {
    	var fibonacci = function(n) {
    		return n == 0 || n == 1 ? 1 : fibonacci(n - 2) + fibonacci(n - 1);
    	};
    	fibonacci = klib.cached(fibonacci);
    	klib.logged(klib.timed(fibonacci))(25);
    },
    function() {
    	var myLog = klib.bound(klib.log, 'MY LOG');
    	myLog(1, 2, 3);
    	myLog('a', 'b', 'c');
    	var tupledMyLog = klib.tupled(myLog);
    	tupledMyLog([1, 2, 3]);
    	tupledMyLog(['a', 'b', 'c']);
    	var untupledTupledMyLog = klib.untupled(tupledMyLog);
    	untupledTupledMyLog(1, 2, 3);
    	untupledTupledMyLog('a', 'b', 'c');
    },
    function() {
    	function fail() {
    		return fail.index.index;
    	}
    	klib.logged(klib.suppressed(fail))();
    	klib.logged(klib.suppressed(fail, 1337))();
    	klib.logged(klib.suppressed(fail, 31337, true))();
    },
    function() {
    	function MyType() {
    		this.counter = 0;
    	}
    	MyType.prototype.increment = function(n) {
    		this.counter += n;
    		return this.counter;
    	};
    	MyType.prototype.decrement = function(n) {
    		this.counter -= n;
    		return this.counter;
    	};
    	MyType.prototype.decrement = klib.paramsTransformed(MyType.prototype.decrement, function(value) {
    		return value >= 1 ? value : 1;
    	});
    	klib.patch(MyType.prototype, {increment: klib.logged,
			  						  decrement: klib.logged});
    	var myObject = new MyType();
    	myObject.increment(1);
    	myObject.decrement(2);
    	myObject.decrement(-5);
    	myObject.increment(8);
    },
    function() {
    	var fancyLog = klib.defaultValues(function(msg, date, file, module) {
    		klib.log(module, file, date, msg);
    	}, 'empty message', undefined, 'myfile', 'mymodule');
    	fancyLog('test', new Date());
    	fancyLog(undefined, new Date());
    	fancyLog('test', new Date(), 'file');
    	fancyLog('test', new Date(), 'file', 'module');
    	var invertedFancyLog = klib.paramsInverted(fancyLog);
    	invertedFancyLog('mod', 'file', new Date(), 'inverted');
    	invertedFancyLog('file', new Date(), 'inverted');
    	invertedFancyLog(new Date(), 'inverted');
    },
    function() {
    	var kwFunc = klib.keywordParams(function(a, b, c, d) {
    		klib.log('A', a, 'B', b, 'C', c, 'D', d);
    	}, 'a', 'b', 'c', 'd');
    	kwFunc({a: 4, b: 9});
    	kwFunc({d: 2, a: 1});
    },
    function() {
    	var logThreaded = klib.threaded(klib.bound(klib.log, '1'));
    	var log = klib.bound(klib.log, '2');
    	logThreaded();
    	log();
    },
]);